﻿@model SpyApp.Models.AccountModel.RegisterModel
@{
    ViewBag.Title = "Register";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="page-header">
    <h3>@ViewBag.Title</h3>
</div>

@using (Html.BeginForm("Register", "Account", FormMethod.Post))
{
    <div class="form-post">
        <h3 class="form-header hidden"></h3>
        @Html.ValidationSummary(true)
        <ul>
           <li class="form-row">
                @Html.LabelFor(m => m.Email, new { @class = "form-column form-label medium-2 xsmall-12" })
                <div class="form-column medium-8 xsmall-12">
                    @Html.TextBoxFor(m => m.Email,
                        new { placeholder = Html.DisplayNameFor(t => t.Email), @class = "form-textbox" })
                    @Html.ValidationMessageFor(m => m.Email)
                </div>
            </li>
            <li class="form-row">
                @Html.LabelFor(m => m.Password, new { @class = "form-column form-label medium-2 xsmall-12" })
                <div class="form-column medium-8 xsmall-12">
                    @Html.PasswordFor(m => m.Password,
                        new { placeholder = Html.DisplayNameFor(t => t.Password), @class = "form-textbox" })
                    @Html.ValidationMessageFor(m => m.Password)
                </div>
            </li>
            <li class="form-row">
                @Html.LabelFor(m => m.ConfirmPassword, new { @class = "form-column form-label medium-2 xsmall-12" })
                <div class="form-column medium-8 xsmall-12">
                    @Html.PasswordFor(m => m.ConfirmPassword,
                        new { placeholder = Html.DisplayNameFor(t => t.ConfirmPassword), @class = "form-textbox" })
                    @Html.ValidationMessageFor(m => m.ConfirmPassword)
                </div>
            </li>
            <li class="form-row">
                @Html.LabelFor(m => m.Captcha, new { @class = "form-column form-label medium-2 xsmall-12" })
                <div class="form-column medium-8 xsmall-12">
                    @Html.TextBoxFor(model => model.Captcha, new{ @class = "form-textbox" })
                    <img id="captcha-image" src='@Url.Action("CaptchaImage", "MyCaptcha", "")' alt="Captcha"/>
                    <img id="refresh-captcha" src="~/Images/refresh.png" alt="Refresh captcha code" />
                    @Html.ValidationMessageFor(model => model.Captcha)
                </div>
            </li>
            <li class="form-row">
                <div class="form-column medium-2 xsmall-12"></div>
                <div class="form-column medium-8 xsmall-12">
                    <input type="submit" value="Register" />
                </div>
            </li>
        </ul>
    </div>
}

@section Script {
    @Scripts.Render("~/bundles/jqueryval")
    <script type="text/javascript">
        RefreshCaptcha("refresh-captcha", "captcha-image", '@Url.Action("CaptchaImage", "MyCaptcha", "")');
    </script>
}